package locations.actions;

import javax.servlet.http.HttpServletRequest;

import locations.dao.DAOFactory;
import locations.dao.InstitutionTypeDAO;

import org.apache.struts2.interceptor.ServletRequestAware;

import com.opensymphony.xwork2.ActionSupport;

public class DeleteInstitutionTypeAction extends ActionSupport implements ServletRequestAware {

	private static final long serialVersionUID = -8124957730231198191L;
	
	private HttpServletRequest request; 
	
	public String execute(){
		Long id = Long.parseLong(this.getRequest().getParameter("id"));
		InstitutionTypeDAO dao = DAOFactory.getInstitutionTypeDAO();
		dao.delete(id);
		return SUCCESS;
	}
	
	public HttpServletRequest getRequest() {
		return request;
	}


	@Override
	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
		
	}

}
